<template>
	<div>
		<el-form :inline="true" :model="ExpenseList.searchData" class="demo-form-inline">
			<el-form-item label="姓名">
				<el-input v-model="ExpenseList.searchData.userName" placeholder="输入姓名"></el-input>
			</el-form-item>
			<el-form-item label="工号">
				<el-input v-model="ExpenseList.searchData.jobNumber" placeholder="输入工号"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" @click="ExpenseListsearch">搜索</el-button>
				<el-button type="primary" @click="ExpenseListreset">重置</el-button>
			</el-form-item>
		</el-form>
		<el-table ref="multipleTable" :data="ExpenseList.tableData" style="width: 100%">
			<el-table-column prop="name" label="姓名"></el-table-column>
			<el-table-column prop="jobNumber" label="工号"></el-table-column>
			<el-table-column prop="address" label="认证情况">
				<template slot-scope="scope">
					<div v-if="scope.row.state == 'SUCCESS'">已认证</div>
					<div v-else-if="scope.row.state == 'PROCESS'">认证中</div>
					<div v-else-if="scope.row.state == 'FAIL'">认证失败</div>
					<div v-else>未认证</div>
				</template>
			</el-table-column>
			<el-table-column prop="mainCompanyName" label="主团队">
				<template slot-scope="scope">
					{{scope.row.mainCompanyName?scope.row.mainCompanyName:'暂无主团队'}}
				</template>
			</el-table-column>
			<el-table-column prop="departmentName" label="现加入部门">
				<template slot-scope="scope">
					{{scope.row.departmentName?scope.row.departmentName:'暂无部门'}}
				</template>
			</el-table-column>
			<el-table-column prop="dutiesName" label="职务">
				<template slot-scope="scope">
					{{scope.row.dutiesName?scope.row.dutiesName:'暂无职务'}}
				</template>
			</el-table-column>
			<!-- <el-table-column prop="rankName" label="职级">
				<template slot-scope="scope">
					{{scope.row.rankName?scope.row.rankName:scope.row.cusRankName?scope.row.cusRankName:'暂无职级'}}
				</template>
			</el-table-column> -->
			<el-table-column prop="address" label="岗位">
				<template slot-scope="scope">
					<div v-if="scope.row.postEntityList.length<1">暂无岗位</div>
					<div v-else v-for="item in scope.row.postEntityList" :key="item.id">{{item.labelName}}</div>
				</template>
			</el-table-column>
			<el-table-column prop="address" label="操作">
				<template slot-scope="scope">
					<el-button type="text" size=" " @click="$router.push(`/myteam/teaminfo/editormenberaudit/${scope.row.userId}?t=${new Date().getTime()}`)" v-has="'c-审核'">审核</el-button>
				</template>
			</el-table-column>
		</el-table>
		<pagina-tion :totalNum="ExpenseList.pageTotal" @paginaClick="paginaClickExpenseList"></pagina-tion>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				companyId: '',
				ExpenseList: {
					tableData: [],
					pageTotal: 0,
					searchData: {
						companyId: '',
						userName: '',
						jobNumber: '',
						pageTemp: 1,
						pageSizeTemp: $globalData.pageSize,
						administrator: null
					}
				}
			}
		},
		mounted() {
			this.companyId = this.ExpenseList.searchData.companyId = this.$store.state.company.selectCompanyId?this.$store.state.company.selectCompanyId:this.$store.state.company.companyId
			if(this.companyId){
				this.getExpenseList()
			}
		},
		methods:{
			// 待审核
			getExpenseList(){
				this.$request.postForm(this.$api.getUnrevised, this.ExpenseList.searchData).then(res=>{
					if(res.code == 200){
						this.ExpenseList.tableData = res.data.items
						this.ExpenseList.pageTotal = res.data.totalPage
					}
				})
			},
			paginaClickExpenseList(val){
				this.ExpenseList.searchData.pageTemp = val
				this.getExpenseList()
			},
			ExpenseListsearch(){
				this.ExpenseList.searchData.pageTemp = 1
				this.getExpenseList()
			},
			ExpenseListreset(){
				this.ExpenseList.searchData.userName = ''
				this.ExpenseList.searchData.jobNumber = ''
				this.ExpenseListsearch()
			},
		}
	}
</script>

<style>
</style>
